feat: list available ".env" variable names for non-hosted apps#437
feat: list available ".env" variable names for non-hosted apps#437
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #437 +/- ##
==========================================
- Coverage 70.42% 70.41% -0.01%
==========================================
Files 221 221
Lines 18533 18539 +6
==========================================
+ Hits 13051 13055 +4
- Misses 4308 4310 +2
Partials 1174 1174 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| "List environment variables available to the app at runtime.", | ||
| "", | ||
| "This command is supported for apps deployed to Slack managed infrastructure but", | ||
| "other apps can attempt to run the command with the --force flag.", | ||
| "Commands that run in the context of a project source environment variables from", | ||
| "the \".env\" file. This includes the \"run\" command.", | ||
| "", | ||
| "The \"deploy\" command gathers environment variables from the \".env\" file as well", | ||
| "unless the app is using ROSI features.", |
cmd/env/list.go
Outdated
| return err | ||
| } | ||
| } else { | ||
| dotEnv, err := hooks.LoadDotEnv(clients.Fs) |
There was a problem hiding this comment.
🪝 note: We reuse the logic that hooks has for gathering environment variables for confidence in matching!
🐟 ramble: We don't require app selection before this at this point, but we might consider keeping it to avoid breaking change if it becomes required later. FWIW it's required for hosted apps so this is familiar experience I think!
srtaalej
left a comment
There was a problem hiding this comment.
working nicely for me! thanks for adding these changes ⭐
| })) | ||
|
|
||
| if len(variableNames) <= 0 { | ||
| if count <= 0 { |
There was a problem hiding this comment.
nice catch i wonder why count was not used here before 🤔
The refactor to the slackdotenv package was not reflected in list.go after merging, leaving a broken reference to hooks.LoadDotEnv. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
@srtaalej Super appreciate the review and testing! 🧪 ✨ I was confused on the guards earlier and perhaps shouldn't have changed it in this PR but IIRC we were considering follow up improvements to these UI soon so I'll merge this! 🧰 |


Changelog
Summary
This PR lists available
.envvariable names for non-hosted apps to match what's available to hooks and theruncommand.Preview
Reviewers
Your check is so appreciated. The following commands might recommend testing:
When done please do delete these apps! This is the environment command kindplace 🌲 ✨
Requirements